<template>
	<view class="main" :style="'top:'+(-demo.height-demo.top-10)+'px'">
		<view class="fixed_head">
			<head1 class="nav_top"
				:style="'height:' +  demo.height + 'px;' + 'padding-top:' + demo.top + 'px;padding-bottom:10px'"
				:nav="title">
			</head1>
		</view>
		<view class="hahah" :style="'padding-bottom:'+(demo.height+demo.top+10)+'px'">
			<view class="myResume" :style="'margin-top:'+(demo.height+demo.top+10)+'px'">
				<view class="myResume_top">
					<view class="myResume_top_photo">
						<image v-if="dataList.resume.photo==''" src="../../static/icon/zhaopinmain.png" mode=""></image>
						<image v-if="dataList.resume.photo!=''" :src="webImgUrl+dataList.resume.photo" mode=""></image>
					</view>
					<view class="myResume_top_info">
						<view class="mti_tit dis_flex">
							<text>基本信息</text>
						</view>
						<view class="mti_info">
							<view>学校：<text>{{$praseStrEmpty(dataList.resume.school)}}</text></view>
							<view>学历：<text>{{$praseStrEmpty(dataList.resume.educationName)}}</text></view>
							<view>专业：<text>{{$praseStrEmpty(dataList.resume.major)}}</text></view>
							<view>职称：<text>{{$praseStrEmpty(dataList.resume.title)}}</text></view>
							<view style="width: 500rpx;">联系方式：<text>{{$praseStrEmpty(dataList.resume.tel)}}</text></view>
						</view>
					</view>
				</view>
				<view class="myResume_main">
					<view class="main_tit">工作经历</view>
					<view class="work_list" v-for="(item,index) in dataList.experience">
						<view class="dis_flex work_list_title ">
							<text class="fir">{{item.companyName}}</text>
							<view class="common_font_style">
								<text v-if="item.startTime!='' && item.startTime!=null">{{item.startTime}}</text>
								<text v-if="item.endTime!='' && item.endTime!=null">~~</text>
								<text v-if="item.endTime=='' || item.endTime==null">~~至今</text>
								<text v-if="item.endTime!='' && item.endTime!=null">{{item.endTime}}</text>
							</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="">
								<text class="common_font_style">见证人：</text><text>{{item.witness}}</text>
							</view>
							<view class="zc" v-if="item.position!='' && item.position!=null">{{item.position}}</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="">
								<text class="common_font_style">联系方式：</text><text>{{item.witnessTel}}</text>
							</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="">
								<text class="common_font_style">工作职责：</text><text>{{item.duty}}</text>
							</view>
						</view>
					</view>
					<view class="main_tit">项目业绩</view>
					<view class="work_list" v-for="(item,index) in dataList.career" :key="index">
						<view class="dis_flex work_list_title ">
							<text class="fir">{{item.project}}</text>
							<view class="common_font_style">{{$praseStrEmpty(item.startTime)}}<text
									v-if="$praseStrEmpty(item.endTime)!=''">~~{{$praseStrEmpty(item.endTime)}}</text>
									
									<text
											v-if="$praseStrEmpty(item.endTime)=='' || $praseStrEmpty(item.endTime)==undefined">~~至今</text>
							</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="dis_flex par">
								<text class="common_font_style">所在公司：</text><text
									class="now_par">{{item.companyName}}</text>
							</view>
							<view class="zc" v-if="item.role!=null || item.role!='' || item.role!=undefined">
								{{item.role}}</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="">
								<text
									class="common_font_style">项目分类：</text><text>{{$praseStrEmpty(item.classificationName)}}</text>
							</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="">
								<text
									class="common_font_style">工业用途：</text><text>{{$praseStrEmpty(item.purposeName)}}</text>
							</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="">
								<text class="common_font_style">建设性质：</text><text>{{$praseStrEmpty(item.natureName)}}</text>
							</view>
						</view>
						<view class="work_list_jzr dis_flex">
							<view class="">
								<text class="common_font_style">项目描述：</text><text>{{$praseStrEmpty(item.remark)}}</text>
							</view>
						</view>
					</view>
					<view class="main_tit">感兴趣内容</view>
					<view class="work_list myRe_tag " v-if="work_list.length!=1">
						<text class="dis_flex" v-for="(item,index) in work_list" :key="index"
							v-if="item!=''">{{item}}</text>
					</view>
					<view class="main_tit">求职意向</view>
					<view class="work_list hoby" v-if="(dataList.resume.intention)!=''">
						<text>{{dataList.resume.intention}}</text>

					</view>
					<view class="main_tit">个人特长</view>
					<view class="work_list hoby" v-if="(dataList.resume.specialty)!=''">
						<text>{{dataList.resume.specialty}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import head1 from '../../common/head/head'
	export default {
		components: {
			head1,
		},

		data() {
			return {
				title: '我的简历预览',
				demo: {
					top: '',
					height: ''
				},
				webImgUrl: '',
				dataSpecialty: {
					specialty: ''
				},
				dataList: {},
				work_list: []
			}
		},

		onLoad(option) {
			this.dataList = JSON.parse(decodeURIComponent(option.data))
			console.log(this.dataList)
			// 感兴趣
			if (this.dataList.resume.interest != null) {
				this.work_list = (this.dataList.resume.interest).split('@@')
			}
		},
		created() {
			const demo = uni.getMenuButtonBoundingClientRect()
			this.demo.top = demo.top
			this.demo.height = demo.height
			// 获取图片前缀
			this.webImgUrl = this.$webUrl
		},
		methods: {
			test() {
				this.$forceUpdate()
			},
			// 编辑简历
			edit() {
				uni.navigateTo({
					url: "../myResume/editResume"
				})
			},
			// 添加简历信息（经历、业绩等）
			addResumeInfo(info) {
				if (info == 0) {
					uni.navigateTo({
						url: "../WorkExp/addWorkExp"
					})
				}
				if (info == 1) {
					uni.navigateTo({
						url: "../ProjectPerformance/addProjectPerformance"
					})
				}
				if (info == 2) {
					uni.navigateTo({
						url: "../BeInterested/BeInterested"
					})
				}
				if (info == 3) {
					uni.navigateTo({
						url: "../JobSeekingIntention/JobSeekingIntention"
					})
				}
				if (info == 4) {
					uni.navigateTo({
						url: "../PersonalSpecialty/PersonalSpecialty"
					})
				}
			}

		}
	}
</script>

<style lang="scss" scoped>
	.main {

		// position: fixed;
		// top: 0;
		// z-index: 999;
		// height: 100%;
		// width: 100%;
		.fixed_head {
			position: fixed;
			z-index: 9999;
		}

		.nav_top {
			position: relative;
			background: #ffffff;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;
			min-width: 750rpx;
		}

		.hahah {
			height: 100%;
			overflow: auto;
			background: #ffffff;
			box-sizing: border-box;

			.myResume {
				width: 750rpx;

				// height: 266rpx;
				.myResume_top {
					// background: url(../../static/icon/talentbg.png) no-repeat;
					// background-size: 100% 100%;
					position: relative;

					.myResume_top_photo {
						    text-align: center;
						    background: #5dd1ce;
						    height: 170rpx;
						    display: flex;
						    align-items: center;
						    justify-content: center;
						image {
							margin-top: 15rpx;
							width: 116rpx;
							height: 116rpx;
							border-radius: 50%;
						}
					}

					.myResume_top_info {
						// position: absolute;
						// top: 91rpx;
						// left: 50%;
						// transform: translate(-50%, 35%);
						    border-radius: 5px;
						    box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.1);
						    background: #ffffff;
						     padding: 0 35rpx 19rpx;
						     box-sizing: border-box;
							 margin-top: 20rpx;
					
						.mti_tit {
							padding: 29rpx 40rpx 0 40rpx;
					
							text {
								font-size: 28rpx;
								font-family: PingFang SC, PingFang SC-Medium;
								font-weight: 500;
								color: #333333;
							}
					
							image {
								width: 35rpx;
								height: 35rpx;
							}
						}
					
						.mti_info {
							display: flex;
							flex-wrap: wrap;
							padding: 8rpx 0 0 40rpx;
							border-top: 2rpx dashed #d6d7d7;
							margin-top: 20rpx;
					
							view {
							    width: 50%;
							    padding: 26rpx 0;
							    display: flex;
							    box-sizing: border-box;
					
								text {
									width: 190rpx;
									min-width: 50%;
									background: #f7f7f7;
									border-radius: 10rpx;
									font-size: 25rpx;
									display: flex;
									align-items: center;
									padding-left: 2rpx;
									flex-wrap: nowrap;
									overflow: hidden;
									white-space: nowrap;
									text-overflow: ellipsis;
								}
							}
						}
					}
				}

				.myResume_main {
					width: 664rpx;
					margin: 28rpx auto 0;
					border-radius: 10px;
					box-shadow: 0px 0px 18rpx 0px rgba(0, 0, 0, 0.10);
					margin-top: 30rpx;

					.main_tit {
						height: 90rpx;
						line-height: 90rpx;
						border-bottom: 1rpx solid #e5e5e5;
						font-size: 28rpx;
						font-weight: 700;
						padding: 0 40rpx;
						box-sizing: border-box;
						color: #333333;
					}

					.work_list {
						padding: 27rpx 40rpx 0;
						font-size: 24rpx;
						box-sizing: border-box;
						border-bottom: 1rpx solid #e5e5e5;


						.work_list_title {
							height: 27rpx;
							line-height: 27rpx;
							margin-bottom: 24rpx;

							.fir {

								font-size: 28rpx;
								font-family: PingFang SC, PingFang SC-Medium;
								font-weight: 500;
								text-align: left;
								color: #333333;
							}
						}

						.work_list_jzr {
							margin-bottom: 24rpx;

							.now_par {
								display: block;
								width: 310rpx;
								white-space: nowrap;
								overflow: hidden;
								text-overflow: ellipsis;

							}

							.zc {
								font-size: 24rpx;
								color: #5CD1CE;
								padding: 5rpx 10rpx;
								box-sizing: content-box;
								height: 32rpx;
								border: 1rpx solid #5cd1ce;
								border-radius: 17rpx;
							}
						}
					}

					.myRe_tag {
						display: flex;
						flex-wrap: wrap;
						padding: 30rpx 0;
						box-sizing: border-box;

						text {
							font-size: 24rpx;
							font-family: PingFang SC, PingFang SC-Bold;
							font-weight: 700;
							color: #5cd1ce;
							display: block;
							border: 1rpx solid #5cd1ce;
							border-radius: 18rpx;
							padding: 5rpx 12rpx;
							box-sizing: content-box;
							margin: 8rpx 21rpx;
						}
					}

					.hoby {
						padding-bottom: 10rpx;
						min-height: 134rpx;
					}
				}

			}
		}

	}
</style>
